<div class="row justify-content-center">
    <div class="col-8">
        <form name="editForm" role="form" novalidate (ngSubmit)="save()" #editForm="ngForm">
            <h2 id="jhi-check-task-heading">Create or edit a Check Task</h2>
            <div>
                <jhi-alert-error></jhi-alert-error>
                <div class="form-group" [hidden]="!checkTask.id">
                    <label for="id">ID</label>
                    <input type="text" class="form-control" id="id" name="id"
                        [(ngModel)]="checkTask.id" readonly />
                </div>
                <div class="form-group">
                    <label class="form-control-label" for="field_adminOpenId">Admin Open Id</label>
                    <input type="text" class="form-control" name="adminOpenId" id="field_adminOpenId"
                        [(ngModel)]="checkTask.adminOpenId" required/>
                    <div [hidden]="!(editForm.controls.adminOpenId?.dirty && editForm.controls.adminOpenId?.invalid)">
                        <small class="form-text text-danger"
                        [hidden]="!editForm.controls.adminOpenId?.errors?.required">
                        This field is required.
                        </small>
                    </div>
                </div>
                <div class="form-group">
                    <label class="form-control-label" for="field_guestOpenId">Guest Open Id</label>
                    <input type="text" class="form-control" name="guestOpenId" id="field_guestOpenId"
                        [(ngModel)]="checkTask.guestOpenId" required/>
                    <div [hidden]="!(editForm.controls.guestOpenId?.dirty && editForm.controls.guestOpenId?.invalid)">
                        <small class="form-text text-danger"
                        [hidden]="!editForm.controls.guestOpenId?.errors?.required">
                        This field is required.
                        </small>
                    </div>
                </div>
                <div class="form-group">
                    <label class="form-control-label" for="field_startTime">Start Time</label>
                    <div class="d-flex">
                        <input id="field_startTime" type="datetime-local" class="form-control" name="startTime" [(ngModel)]="startTime" placeholder="YYYY-MM-DD HH:mm"
                        />
                    </div>
                </div>
                <div class="form-group">
                    <label class="form-control-label" for="field_endTime">End Time</label>
                    <div class="d-flex">
                        <input id="field_endTime" type="datetime-local" class="form-control" name="endTime" [(ngModel)]="endTime" placeholder="YYYY-MM-DD HH:mm"
                        />
                    </div>
                </div>
                <div class="form-group">
                    <label class="form-control-label" for="field_statesFlag">States Flag</label>
                    <input type="text" class="form-control" name="statesFlag" id="field_statesFlag"
                        [(ngModel)]="checkTask.statesFlag" />
                </div>
                <div class="form-group">
                    <label class="form-control-label" for="field_warningId">Warning Id</label>
                    <input type="number" class="form-control" name="warningId" id="field_warningId"
                        [(ngModel)]="checkTask.warningId" />
                </div>

            </div>
            <div>
                <button type="button" id="cancel-save" class="btn btn-secondary"  (click)="previousState()">
                    <fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span>Cancel</span>
                </button>
                <button type="submit" id="save-entity" [disabled]="editForm.form.invalid || isSaving" class="btn btn-primary">
                    <fa-icon [icon]="'save'"></fa-icon>&nbsp;<span>Save</span>
                </button>
            </div>
        </form>
    </div>
</div>
